//package com.ruibang.glass.produce.component.consumer;
//
//import com.ruibang.glass.produce.config.RocketMqProperties;
//import com.ruibang.glass.produce.constant.Constants;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
//import org.apache.rocketmq.client.producer.DefaultMQProducer;
//import org.apache.rocketmq.remoting.protocol.heartbeat.MessageModel;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.stereotype.Component;
//
//@Slf4j
//@Component
//public class RocketMQConfig {
//
//
//    @Autowired
//    private RocketMqProperties rocketMqProperties;
//
//    @Autowired
//    private RocketMQMessageListener rocketMQMessageListener;
//
//    @Bean(initMethod = "start", destroyMethod = "shutdown")
//    public DefaultMQPushConsumer rocketMQConsumer() {
//        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(Constants.CONSUMER_GROUP);
//        try {
//            consumer.setMessageModel(MessageModel.CLUSTERING);
//            consumer.setNamesrvAddr(rocketMqProperties.getNameServer());
//            consumer.setPullBatchSize(rocketMqProperties.getPullBatchSize());
//            consumer.subscribe(Constants.DCS_CX_11_TOPIC, "*");
//            consumer.subscribe(Constants.BC_COLD_BC2MES_10_TOPIC, "*");
//            consumer.subscribe(Constants.BC_HOT2_BC2MES_TOPIC, "*");
//            consumer.subscribe(Constants.DCS_YL_11_TOPIC, "*");
//            consumer.subscribe(Constants.DCS_TD_11_TOPIC, "*");
//            consumer.subscribe(Constants.DCS_XZ_11_TOPIC, "*");
//            consumer.setMessageListener(rocketMQMessageListener);
//        } catch (Exception e) {
//            log.error("创建CX消费者失败：{}", e.getMessage());
//        }
//        return consumer;
//    }
//
//
//
//}